package Comp355Final.main;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ScrollView;

public class GUIConfig extends Activity{
	private Config myconfig;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ScrollView scllview = new ScrollView(this);
        ScrollView.LayoutParams scllview_param = new ScrollView.LayoutParams(
        		ViewGroup.LayoutParams.FILL_PARENT,
        		ViewGroup.LayoutParams.FILL_PARENT);
        scllview.setBackgroundColor(Color.WHITE);
        myconfig = new Config(this);
        scllview.setBackgroundDrawable(myconfig.return_bg());
        LinearLayout Llay = new LinearLayout(this);
        LinearLayout.LayoutParams Llay_param = new LinearLayout.LayoutParams(
        		ViewGroup.LayoutParams.FILL_PARENT,
        		ViewGroup.LayoutParams.FILL_PARENT);
        
        
        
        scllview.addView(Llay, Llay_param);
        this.setTitle("Configuration");
        this.setContentView(scllview, scllview_param);
    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    	menu.add(0, 0, 0, "Return to BookShelf").setIcon(android.R.drawable.ic_menu_revert);
    	return super.onCreateOptionsMenu(menu); 
    }
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
    	if(item.getItemId()==0)
    	{
    		Intent int_ent = new Intent(this, GUIBookShelfBkSelect.class);
    		this.startActivity(int_ent);
    		finish();
    	}
    	return super.onOptionsItemSelected(item); 
    }
}
